package com.todo.strategy.pipeline.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Arrays;
import java.util.Map;
import java.util.stream.Collectors;

/**
 * @author azhebuxing
 * @date 2025/2/28 20:37
 * @description
 */
@Getter
@AllArgsConstructor
public enum StrategyActionEnum {

    PLATFORM_STRATEGY(1, "PLATFORM_STRATEGY", "平台攻略"),
    PLATFORM_MEMO(2, "PLATFORM_MEMO", "平台备忘录"),
    PLAN_RELATION(3, "PLAN_RELATION", "攻略关联"),

    ;

    private static Map<Integer, StrategyActionEnum> typeMap = Arrays
            .stream(StrategyActionEnum.values())
            .collect(Collectors.toMap(StrategyActionEnum::getType, item -> item, (v1, v2) -> v2));

    private int type;
    private String code;
    private String name;


    public static StrategyActionEnum getByType(Integer type) {
        return typeMap.get(type);
    }
}
